package fr.jgraph.model.graph;

import fr.jgraph.model.edge.Edge;
import fr.jgraph.model.edge.EdgeFactory;
import fr.jgraph.model.vertex.Vertex;
import fr.jgraph.model.vertex.VertexFactory;

public abstract class AbstractGraph implements Graph {
	private EdgeFactory edgeFactory;
	
	private VertexFactory vertexFactory;
	
	public AbstractGraph(EdgeFactory edgeFac, VertexFactory vertexFac) {
		edgeFactory = edgeFac;
		vertexFactory = vertexFac;
	}
	
	public AbstractGraph(Graph g) {}
	
	public boolean removeVertices(Vertex[] vertices) {
		boolean res = true;
		for (int i = 0; i < vertices.length; i++)
			res &= removeVertex(vertices[i]);
		
		return res;
	}
	
	public boolean removeEdges(Edge[] edges) {
		boolean res = true;
		for (int i = 0; i < edges.length; i++)
			res &= removeEdge(edges[i]);
		
		return res;
	}
	
	public EdgeFactory getEdgeFactory() {
		return edgeFactory;
	}

	public VertexFactory getVertexFactory() {
		return vertexFactory;
	}
}
